﻿Imports System.Data.OleDb

Public Class UnitTestUtils

    Private conn As OleDb.OleDbConnection

    Sub New(connString As String)
        Me.conn = New OleDb.OleDbConnection(connString)
        Me.conn.Open()
    End Sub

    Sub New(ByRef conn As OleDbConnection)
        Me.conn = conn
    End Sub

    Public Function getRowCountFor(table As Tables) As Long
        Dim commandText As String = "select count(*) from " & table.ToString & ";"
        Dim command As New OleDbCommand(commandText, conn)
        Return command.ExecuteScalar()
    End Function

End Class
